import request from '../../utils/request.js'

const state = {
	// test: '测试数据',
	indexData: {},	//首页数据
}
const mutations = {
	CHANGEINDEXDATA(state, indexData) {
		state.indexData = indexData
	}
}
const actions = {
	async getIndexData({commit}) {
		const res = await request('/getIndexData')	//小程序
		// const res = await request('/api/getIndexData')	//h5
		// console.log(res)
		commit('CHANGEINDEXDATA',res.indexData)
	}
}
const getter = {}

export default {
	namespaced: true,
	state,
	mutations,
	actions,
	getter
}